<%@ Page language="c#" Inherits="Dimok.Aspx.Manager.Tracking.Trackers" CodeFile="Trackers.aspx.cs" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
<title>Trakcing Devices</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQUIV="Expires" CONTENT="-1"><meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"><meta name="CODE_LANGUAGE" Content="C#"><meta name="vs_defaultClientScript" content="JavaScript"><meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<?XML:NAMESPACE PREFIX="DIMOK"/>
<?IMPORT namespace="DIMOK" implementation="/include/htc/datagrid.htc">
<LINK rel="stylesheet" type="text/css" href="/CSS/Outlook.css">
<script src="/include/common.js"></script>
<script src="/include/soap.js"></script>
<script src="/include/XML.js"></script>
<script src="/manager/common/common.js"></script>
</head>
<body bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0" scroll="no" onload="window.focus()" onload="page_Load()">
<DIMOK:htcDatagrid id="dtg" caption="Units" allowEdit="true" allowAdd="false" allowDelete="false"
				style="width:100%;overflow-x:visible;height:100%"
				ReadOnlyFields="trackerid,vin,dealer,status,loanid,installer"
				HiddenFields="statusid,style"
				maxrecords="20000"
				onEdit="editRecord('TrackingDevice_Update')"
				ondatabound1="cropWindow()"
				onFilter="fetch()"
				onrowclick="showTracker(event.rs('TrackerID'))"
				onrowselected="showTracker(event.rs('TrackerID'))"
>
		<RS>
			<asp:Literal ID="ltrTrackingDevices" Runat="server"></asp:Literal>
		</RS>
</DIMOK:htcDatagrid>
</TABLE>
</body>
</html>
<script>
cropWindow()
initWS("COMMON_WS","/manager/common/common.asmx");
var w = 500;
external.dialogWidth=w+'px';
external.dialogHeight=w+'px';
external.dialogLeft=(top.screen.availWidth-w)/2;
external.dialogTop=(top.screen.availHeight-w)/2;
//setTimeout(function(){cropWindow();},1000);
function page_Load(){
	alter('Load');
}
function makeBatch(){
	if( !confirm("Insert "+txtQty.value+" trackers?") )return;
	var ret = WS(CO("MakeTrackerIDsBatch"),txtStartID.value,txtQty.value);
	if( showSOAPError(ret) )return false;
	txtStartID.value = "";
	dtg.setRecordset(ret.value);
}
function editRecord(webMethod){
	if(!checkWS()) event.returnValue = false;
	var ret = WS(CO(webMethod),event.fieldName,event.fieldValue,_getID());
	if(showSOAPError(ret)) return event.returnValue = false;
}
function fetch(){
	var filter = (event.rs.filter||"").replace(/[*]/g,"%");
	var ret = WS(CO("TrackingDevice_Get"),encodeXML(filter));
	if( showSOAPError(ret) )return false;
	dtg.setRecordset(ret.value);
}
// **** Properties *****
function _getID(id){
	if( arguments.length > 0 )event.rs("ID").value = id;
	return event.rs("ID").value;
}
</script>
